<?php
declare (strict_types=1);

namespace app\admin\controller;

use app\common\service\SmsCaptchaService;
use think\response\Json;

/**
 * 验证码管理
 */
class Captcha extends AdminBaseController
{
    protected $allowAllAction = [
        'Captcha/sendSmsCaptcha',
    ];

    // 图形验证码
    public function image()
    {
        // $CaptchaService = new CaptchaService;
        // return $this->renderJsonSuccess($CaptchaService->create());
    }

    // 发送短信验证码
    public function sendSmsCaptcha():Json
    {
        $SmsCaptchaService = new SmsCaptchaService;
        $res = $SmsCaptchaService->sendCaptcha(input('mobile'), input('scene'));
        return json($res);
    }
}
